export function intersection<T>(arr1: T[], arr2: T[]) {
    const set1 = new Set(arr1);
    const set2 = new Set(arr2);
    const result = [];

    for (const item of set1) {
        if (set2.has(item)) {
            result.push(item);
        }
    }
    return result;
}
